<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Shoutout.aspx.cs" Inherits="Shoutout" Title="My Shoutout" %>
<%@ Import Namespace="Friendster.Service" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <fs:FriendsterApplication runat="server" ID="fsApplication" ApplicationKey="0c868a9a9f2d332000cd09e1ed602ddc"
    ApplicationName="Creating .NET Client" Secret="7234cc4ad7689d0f8031b2023e252a3d" CallbackUrl="http://localhost:1653/StepByStep/" />
<%
    Response.Write("<div style=\"padding-left:20px\"><strong>My Shoutout</strong><br /><br />");
    if (Page.IsPostBack)
    {
        if(content.Text != null)
        {
            if (fsApplication.Service.Shoutout.PostShoutout(content.Text))
                Response.Write("<br /><strong>ShoutOut content updated.</strong><br /><br />");
        }
    }
    Shoutout[] sout = (Shoutout[])fsApplication.Service.Shoutout.GetShoutout();
    if (!string.IsNullOrEmpty(sout[0].Content))
    {
        Response.Write("<strong>ShoutOut Content: </strong><br/>");
        Response.Write("<strong>Last Updated On: </strong>"+ sout[0].UpdatedOn.Date + "<br />");
        Response.Write("<strong>Content: </strong>" + sout[0].Content);
    }
    else
        Response.Write("<strong>You have no ShoutOut.</strong><br/>");
%>
<br />
<br />
<div>
<strong>Update your shoutout</strong><br />
<asp:TextBox ID="content" runat="server" AutoPostBack="True" BorderColor="#C000C0" Height="76px" Width="234px"></asp:TextBox><br />
<input type="submit" value="Update" />&nbsp;
</div>
</asp:Content>

